---
layout: single
property_name: max-height
---

<section id="max-height" class="property">
  <header class="property-header">
    <nav class="property-links">
        <a class="property-collection" href="{{site.url}}/box-model/">
          In collection: <strong>box-model</strong>
        </a>
      <a class="property-links-direct" href="{{site.url}}/property/max-height/" data-property-name="max-height" data-tooltip="Single page for this property">Permalink</a>
      <a class="property-share" data-tooltip="Share on Twitter or Facebook" data-property-name="max-height">Share</a>
      <a target="_blank" href="https://developer.mozilla.org/en/docs/Web/CSS/max-height" data-tooltip="See on Mozilla Developer Network" rel="external">MDN</a>
    </nav>
    <h2 class="property-name">
      <a href="#max-height"><span>#</span>max-height</a>
    </h2>
    <div class="property-description">
      <p>Defines the maximum height the element can be.</p>

    </div>

  </header>

    <style type="text/css">.max-height { max-width: 400px; }</style>




    <section class="example">
      <header class="example-header">
        <p class="example-name">
            <code class="example-default" data-tooltip="This is the property's default value">default</code>


          <code class="example-value" data-tooltip="Click to copy" data-clipboard-text="max-height: none;">max-height: none;</code>
        </p>
        <div class="example-description">
          <p>The element has <strong>no limit</strong> in terms of height.</p>

        </div>
      </header>

      <aside class="example-preview">
        <div class="example-browser"><i></i><i></i><i></i></div>
        <div class="example-output">
          <div class="example-output-div max-height " id="max-height-none"><p class="block block--alpha">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam semper diam at erat pulvinar, at pulvinar felis blandit. Vestibulum volutpat tellus diam, consequat gravida libero rhoncus ut. Maecenas imperdiet felis nisi, fringilla luctus felis hendrerit sit amet. Pellentesque interdum, nisl nec interdum maximus, augue diam porttitor lorem, et sollicitudin felis neque sit amet erat.</p></div>
        </div>
      </aside>
    </section>
    <section class="example">
      <header class="example-header">
        <p class="example-name">


          <code class="example-value" data-tooltip="Click to copy" data-clipboard-text="max-height: 2000px;">max-height: 2000px;</code>
        </p>
        <div class="example-description">
          <p>You can use <strong>numeric values</strong> like <strong>pixels</strong>, <strong>(r)em</strong>, <strong>percentages</strong>...</p>
<p>If the <em>maximum</em> height is <strong>larger</strong> than the element&#39;s <em>actual</em> height, the max height has <strong>no effect</strong>.</p>

        </div>
      </header>

      <aside class="example-preview">
        <div class="example-browser"><i></i><i></i><i></i></div>
        <div class="example-output">
          <div class="example-output-div max-height " id="max-height-2000px"><p class="block block--alpha">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam semper diam at erat pulvinar, at pulvinar felis blandit. Vestibulum volutpat tellus diam, consequat gravida libero rhoncus ut. Maecenas imperdiet felis nisi, fringilla luctus felis hendrerit sit amet. Pellentesque interdum, nisl nec interdum maximus, augue diam porttitor lorem, et sollicitudin felis neque sit amet erat.</p></div>
        </div>
      </aside>
    </section>
    <section class="example">
      <header class="example-header">
        <p class="example-name">


          <code class="example-value" data-tooltip="Click to copy" data-clipboard-text="max-height: 100px;">max-height: 100px;</code>
        </p>
        <div class="example-description">
          <p>If the content does not fit within the maximum height, it will <strong>overflow</strong>. How the container will handle this overflowing content is defined by the <code class="shorthand"><a href="http://cssreference.io/#overflow">overflow</a></code> property.</p>

        </div>
      </header>

      <aside class="example-preview">
        <div class="example-browser"><i></i><i></i><i></i></div>
        <div class="example-output">
          <div class="example-output-div max-height " id="max-height-100px"><p class="block block--alpha">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam semper diam at erat pulvinar, at pulvinar felis blandit. Vestibulum volutpat tellus diam, consequat gravida libero rhoncus ut. Maecenas imperdiet felis nisi, fringilla luctus felis hendrerit sit amet. Pellentesque interdum, nisl nec interdum maximus, augue diam porttitor lorem, et sollicitudin felis neque sit amet erat.</p></div>
        </div>
      </aside>
        <style type="text/css">#max-height-100px .block { max-height: 100px; }</style>
    </section>

</section>
